<template>
  <div id="container">
    <counter ref="one" @change="handleChange" content="123"></counter>
    <counter ref="two" @change="handleChange" content="321"></counter>
    <div>{{total}}</div>
  </div>
</template>

<script>
import Counter from './Counter'
export default {
    components: {
        Counter
    },
    data() {
        return {
            total: 0
        }
    },
    methods: {
        handleChange(num) {
            this.total += num
        }
    }
}

</script>
<style>
</style>